﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Linq;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace DevExpress.MailClient.Win.TasksManager
{
    public partial class ucWorkFlowInformatinViewer : PRO_DOCS.BLL.WIN.Templates.DevxPermissionUserControlTemplate
    {
        public void DISPLAY_FILE_WORKFLOW_INFOEMATION(PRO_DOCS.DAL.Database.ARCHIVE_DEPARTMENT_FILE_WORKFLOW aRCHIVE_DEPARTMENT_FILE_WORKFLOW_INSTANCE)
        {
            txtCreatedBy.Text = aRCHIVE_DEPARTMENT_FILE_WORKFLOW_INSTANCE.LOGIN_USER.EMPLOYEE_FULL_NAME;
            txtCreationDate.Text = aRCHIVE_DEPARTMENT_FILE_WORKFLOW_INSTANCE.APPLICATION_WORKFLOW_INSTANCE_CREATION_DATE.Value.ToString();
            txtCurrentStatus.Text = aRCHIVE_DEPARTMENT_FILE_WORKFLOW_INSTANCE.APPLICATION_WORKFLOW_STATUSE.APPLICATION_WORKFLOW_STATUS_NAME;

        }
        public ucWorkFlowInformatinViewer()
        {
            InitializeComponent();
            ucFileDynamicIndeciesDetails1.SHOW_DOCUMENT_TYPE = false;
        }

        internal bool SET_FILE_WORKFLOW_ACTION(TasksManagerViewer.WORKFLOW_ACTIONS wORKFLOW_ACTION, PRO_DOCS.DAL.Database.ARCHIVE_DEPARTMENT_FILE_WORKFLOW _cURRENT_ARCHIVE_DEPARTMENT_FILE_WORKFLOW_INSTANCE)
        {
            bool action_done = false;

            dxErrorProvider1.ClearErrors();

            Forms.frmWorkFlowDecesinoMaking workflowDecesion = new Forms.frmWorkFlowDecesinoMaking(_cURRENT_ARCHIVE_DEPARTMENT_FILE_WORKFLOW_INSTANCE);
            if (workflowDecesion.ShowDialog().Equals(DialogResult.OK))
            {
                
                action_done = true;
            }
            else
            {
                dxErrorProvider1.SetError(lblActionReply, PRO_DOCS.BLL.WIN.Properties.ErrorProviderMessages.Default.InputLeftBlank.Replace("{name}", "Decesion reply"), XtraEditors.DXErrorProvider.ErrorType.Information);
            }

            return action_done;
        }
    }
}
